import 'package:cream_chat_flutter/assets/Icons.dart';
import 'package:cream_chat_flutter/components/HiChip.dart';
import 'package:cream_chat_flutter/globals/ThemeProvider.dart';
import 'package:flutter/material.dart';

Widget getMyRelatedItem(ThemeProvider tp ,String avatar, Text nickname, int gender, int age,
        int intimacyLevel) =>
    Container(
      width: 96,
      padding: EdgeInsets.only(top: 5, right: 16),
      child: Column(
        children: [
          Padding(
              padding: EdgeInsets.only(bottom: 5),
              child: ClipRRect(
                borderRadius: BorderRadius.all(Radius.circular(8)),
                child: Image.network(avatar),
              )),
          Row(
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              Container(
                constraints: BoxConstraints(maxWidth: 60),
                padding: EdgeInsets.only(right: 3),
                child: nickname,
              ),
              HiChip(
                  Text("$age",
                      style: TextStyle(color: Colors.white, fontSize: 10)),
                  avatar: gender == 1?getManIcon(width: 10, height: 10):getWomanIcon(width: 10, height: 10),
                  color: tp.getGenderColor(gender))
            ],
          ),
          Row(
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              Padding(
                  padding: EdgeInsets.only(right: 3),
                  child: getIntimacyIcon(width: 10, height: 10, color: tp.getGenderColor(gender))),
              Text("密友Lv.$intimacyLevel", style: TextStyle(fontSize: 10, color: tp.getGenderColor(gender)))
            ],
          ),
        ],
      ),
    );
